﻿using System;
using AZROLESLib;

namespace AzManContrib.MVC.Initialization
{
    public abstract class AzManClientContextBase : IAzManClientContext
    {
        private readonly Func<string> _returning;

        protected AzManClientContextBase(Func<string> returning)
        {
            _returning = returning;
        }

        public virtual object AccessCheck(string bstrObjectName, object varScopeNames, object varOperations, object varParameterNames, object varParameterValues, object varInterfaceNames, object varInterfaceFlags, object varInterfaces)
        {
            return _returning();
        }

        public abstract bool AccessCheck(IAzOperation operation);

        public virtual string GetBusinessRuleString()
        {
            return _returning();
        }

        public virtual object GetProperty(int lPropId, object varReserved)
        {
            return _returning();
        }

        public virtual object GetRoles(string bstrScopeName)
        {
            return _returning();
        }

        public virtual string UserDn
        {
            get { return _returning(); }
        }

        public virtual string UserSamCompat
        {
            get { return _returning(); }
        }

        public virtual string UserDisplay
        {
            get { return _returning(); }
        }

        public virtual string UserGuid
        {
            get { return _returning(); }
        }

        public virtual string UserCanonical
        {
            get { return _returning(); }
        }

        public virtual string UserUpn
        {
            get { return _returning(); }
        }

        public virtual string UserDnsSamCompat
        {
            get { return _returning(); }
        }

        public virtual string RoleForAccessCheck
        {
            get { return _returning(); }
            set { }
        }
    }
}
